import Vue from 'vue'
import Vuex from 'vuex'
import {getToken} from '@/utils/auth'
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    token:getToken(),
   userInf:{
     uid:'',
     uname:'',

   }
  },
  mutations: {
    setUserId(state, uid){
          state.userInf.userId=uid
      },
    setUname(state, uname) {
      state.userInf.uname = uname
    },
    setStateToken(state,token){
      state.token = token
    },
  },
  actions: {
  },
  modules: {
  }
})
